<template>
    <button @click="deleteItem(tid)">delete</button>
    <button @click="changedone(tid)">{{done?"已完成":"未完成"}}</button>
    <button @click="nplus" ref="donebtn">{{n}}click</button>
</template>

<script>
import { reactive, toRefs ,inject,nextTick,ref} from 'vue'

export default {
    props:["tid","done"],
    setup () {
        
        // let comdone=(id)=>{
        //     console.log('comdone==>',id)
        // }
        let changedone=inject("changedone");
        let deleteItem=inject("deleteItem");
        let donebtn=ref(null);
        let n=ref(1);
        let nplus=()=>{
            n.value++;
            nextTick(()=>{
                console.log(donebtn.value.innerText);
            })
        }
        return {
            changedone,
            deleteItem,donebtn,n,nplus
        }
    }
}
</script>

<style lang="scss" scoped>

</style>